package com.henanuniversity.controller;

import com.henanuniversity.po.Business;
import com.henanuniversity.service.impl.BusinessServiceimpl;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;

public class BusinessController {
    public List<Business> listBusinessByOrderTypeId(HttpServletRequest request, HttpServletResponse response){
        List<Business> list = new ArrayList<>();
        BusinessServiceimpl service = new BusinessServiceimpl();

        String orderTypeId1 = request.getParameter("orderTypeId");
        Integer orderTypeId =Integer.parseInt(orderTypeId1) ;
        list=service.listBusinessByOrderTypeId(orderTypeId);
        return list;

    }
    public Business getBusinessById(HttpServletRequest request, HttpServletResponse response){
        Business business = new Business();
        BusinessServiceimpl service = new BusinessServiceimpl();
        Integer businessId = Integer.parseInt(request.getParameter("businessId"));
        business=service.getBusinessById(businessId);
        return business;
    }
}
